package thongke;

import java.awt.Button;
import java.awt.Choice;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

public class thongke extends Frame implements ActionListener,ItemListener {
	Button btxem,btexit;
	TextField txttt, txtloinhuan,txtthiethai;
	Label lbtt,lbloinhuan,lbthiethai,lbmay,lbngay;
	Panel pn,pn1,pn2,pn3;
	Choice c1,c2;
	public void GUI(){
		lbmay=new Label("SỐ MÁY");
		lbtt=new Label("TỔNG THU");
		lbloinhuan=new Label("LỢI NHUẬN");
		lbthiethai=new Label("THIỆT HẠI");
		lbngay= new Label("THỜI GIAN");
		txttt=new TextField("");
		txtloinhuan=new TextField("");
		txtthiethai=new TextField("");
		c1=new Choice();
		c1.addItem("máy 1");
		c1.addItem("máy 2");
		c1.addItem("máy 3");
		c2=new Choice();
		btxem=new Button("XEM");
		btexit=new Button("THOÁT");
		btxem.addActionListener(this);
		btexit.addActionListener(this);
		pn=new Panel(new GridLayout(3, 1));
		pn1=new Panel(new FlowLayout());
		pn2=new Panel(new GridLayout(4, 2));
		pn3=new Panel(new FlowLayout());
		pn1.add(lbmay); pn1.add(c1);
		pn2.add(lbngay); pn2.add(c2);
		pn2.add(lbtt); pn2.add(txttt);
		pn2.add(lbloinhuan); pn2.add(txtloinhuan);
		pn2.add(lbthiethai); pn2.add(txtthiethai);
		pn3.add(btxem); pn3.add(btexit);
		pn.add(pn1); pn.add(pn2); pn.add(pn3);
		add(pn);
		setSize(500	, 400);
		show();
}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==btexit)
			System.exit(0);
	}
	@Override
	public void itemStateChanged(ItemEvent e) {
		// TODO Auto-generated method stub
		
	}
	public thongke(String st){
		super(st);
		GUI();
	}
	public static void main(String[] avg){
		new thongke("THỐNG KÊ");
	}
}